package com.mti.epivisite.common.event
{
	import flash.net.registerClassAlias;
	import flash.utils.ByteArray;
	
	import mx.collections.ArrayCollection;
	import mx.utils.ObjectUtil;
	
	[Bindable] 
	[RemoteClass(alias="com.serverplic.media.Event")] 
	public class EpivisiteEvent
	{
		public function EpivisiteEvent()
		{
			deletedPointList = new ArrayCollection();
		}
		
		public var id:int = 0;
		public var name:String = null;
		public var title:String = null;
		public var password:String = null;
		public var description:String = null;
		public var mapPath:String = null;
		public var mapArray:ByteArray = null;
		public var startDate:Date = null;
		public var endDate:Date = null;
		
		public var pointList:ArrayCollection = null;
		public var deletedPointList:ArrayCollection = null;
		
		public function toString():String
		{
			return name;
		}
		
		private static var isRegistered:Boolean = false;
		
		/**
		 * Create a deep copy of the Event and return it.
		 */
		public function Copy():EpivisiteEvent
		{
			if (isRegistered == false)
			{
				// Register type information to be able to cast.
				// See http://aheadofthewave.wordpress.com/2007/08/15/type-casting-and-objectutilcopyobj-in-actionscript-30/
				registerClassAlias("com.mti.epivisite.common.EpivisiteEvent", EpivisiteEvent);
			}
			return ObjectUtil.copy(this) as EpivisiteEvent;
		}
	}
}